﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace FilstartupsREST.FILSTARTUPSService.rest
{
    public class ServiceRestRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get { return "ServiceRest"; }
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            /********************************************************************************************/

            /**** POST ****/

            //GetSearchPost
            context.MapRoute(
                "ServiceRest_GetSearchPost",
                "FilstartUpsRest/filstartupsservice/rest/post/GetSearchPost/{name}",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetSearchPost" });

            //GetEventDetails
            context.MapRoute(
                "ServiceRest_GetEventDetails",
                "FilstartUpsRest/filstartupsservice/rest/post/GetEventDetail/{id}",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetEventDetail" });
            
            /** FILSTARTUPS- FRONT GET ARTICLES DETAILS /{posttitle}**/
            context.MapRoute(
            "ServiceRest_GetArticleDetails",
                "FilstartUpsRest/filstartupsservice/rest/post/GetArticleDetails/{id}",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetArticleDetails" });

            //GetImage
            context.MapRoute(
                "ServiceRest_GetImagePost",
                "FilstartUpsRest/filstartupsservice/rest/post/GetPostImage/{id}",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetPostImage" }
                );
            //GetFeatured Post
            context.MapRoute(
                "ServiceRest_GetFeaturedPost",
                    "FilstartUpsRest/filstartupsservice/rest/post/GetFeaturedPost/",
                    new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetFeaturedPost" });

            /** GET POST DETAILS /{posttitle}**/
            context.MapRoute(
            "ServiceRest_GetPostDetails",
                "FilstartUpsRest/filstartupsservice/rest/post/GetPostDetails/{id}",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetPostDetails" });

            /*** GET SUBPAGE ARTICLE 
            context.MapRoute(
               "Services_GetPostCategory",
                "FilstartUpsRest/filstartupsservice/rest/post/GetPostCategory/{id}/{categoryname}",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetPostCategory" }
               ); ***/

            /**GET POSTARCHIEVES **/
            context.MapRoute(
                "ServiceRest_GetPostArchieves",
                "FilstartUpsRest/filstartupsservice/rest/post/GetPostArchieves/{id}",
                    new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetPostArchieves" });

            /** GET TOP5 NEWEST POST **/
            context.MapRoute(
                  "ServiceRest_GetLatestPost",
                  "FilstartUpsRest/filstartupsservice/rest/post/GetLatestArticles",
                  new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetLatestArticles" });

            /** GET TOP 5 NEWEST NEWS **/
            context.MapRoute(
                "ServiceRest_GetNewsDetails",
                "FilstartUpsRest/filstartupsservice/rest/post/GetNewsDetails",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetNewsDetails" });

            /** GET TOP 5 NEWEST EVENT **/
            context.MapRoute(
                "ServiceRest_GetLatestEvents",
                    "FilstartUpsRest/filstartupsservice/rest/post/GetLatestEvents",
                    new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetLatestEvents" });

            /** GET EVENTS ARCHIVES **/
            context.MapRoute(
                "ServiceRest_GetEventArchives",
               "FilstartUpsRest/filstartupsservice/rest/post/GetEventArchives",
               new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetEventArchives" });

            /*** TEST PAGING ARCHIEVES POST ***/
            context.MapRoute(
                "ServiceRest_GetArticleArchieves",
                "FilstartUpsRest/filstartupsservice/rest/post/GetArticleArchieves/{id}",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "GetArticleArchieves" });

            /*****************************************************************************************************/

            /***** PAGES ****/
            /** Get Page Skip(8) **/
            context.MapRoute(
                "Services_GetPageSkip",
               "FilstartUpsRest/filstartupsservice/rest/page/GetPageSkip",
               new { controller = "Page", postUrl = UrlParameter.Optional, action = "GetPageSkip" });


            /**GET Mobile Page **/
            context.MapRoute(
                "Services_GetPageMobileInfo",
                "FilstartUpsRest/filstartupsservice/rest/page/GetPageMobileInfo",
                    new { controller = "Page", postUrl = UrlParameter.Optional, action = "GetPageMobileInfo" });


            /**GET PAGE **/
            context.MapRoute(
                "Services_GetPageInfo",
                "FilstartUpsRest/filstartupsservice/rest/page/GetPageInfo",
                    new { controller = "Page", postUrl = UrlParameter.Optional, action = "GetPageInfo" });

            /**GET PAGE FULL INFO **/
            context.MapRoute(
                "Services_GetPageFullInfo",
                "FilstartUpsRest/filstartupsservice/rest/page/GetPageFullInfo/{id}",
                    new { controller = "Page", postUrl = UrlParameter.Optional, action = "GetPageFullInfo" }
                );
            /***************************************************************************************************/

            /***** CATEGORY *******/
            /**GET PAGENAV SUB **/
            context.MapRoute(
                "Services_GetPageSub",
                "FilstartUpsRest/filstartupsservice/rest/category/GetPageSub/{id}",
                  new { controller = "Category", postUrl = UrlParameter.Optional, action = "GetPageSub" }
                );

            /** GET POST **/
            context.MapRoute(
                "Services_GetCategoryPost",
                "FilstartUpsRest/filstartupsservice/rest/category/GetCategoryPost/{id}",
                  new { controller = "Category", postUrl = UrlParameter.Optional, action = "GetCategoryPost" }
                );

            /** GET CATEGORIES **/
            context.MapRoute(
                    "Services_GetCategoryInfo",
                    "FilstartUpsRest/filstartupsservice/rest/category/GetCategoryInfo",
                    new { controller = "Category", postUrl = UrlParameter.Optional, action = "GetCategoryInfo" });

            /** GET SEARCH **/
            context.MapRoute(
                "Services_GetSearch",
                "FilstartUpsRest/filstartupsservice/rest/category/GetSearchCategory/{searchquery}/{id}",
                new { controller = "Category", postUrl = UrlParameter.Optional, action = "GetSearchCategory" });

            /***************************************************************************************************/

            /***** FORUM *****/

            /**GET MAIN TOPIC**/
            context.MapRoute(
                "Service_GetForum",
                "FilstartUpsRest/filstartupsservice/rest/forum/GetForumTopic",
                 new { controller = "Forum", postUrl = UrlParameter.Optional, action = "GetForumTopic" });

            context.MapRoute(
                "Service_Views",
                "FilstartUpsRest/filstartupsservice/rest/forum/ForumViews/{forumidPK}",
                new { controller = "Forum", postUrl = UrlParameter.Optional, action = "ForumViews" });

            /**** TEST FOR LATEST ARTICLES *****/

            context.MapRoute(
                "Serives_Get",
                "FilstartUpsRest/filstartupsservice/rest/post/Get",
                new { controller = "Post", postUrl = UrlParameter.Optional, action = "Get" }
                );
        }
    }
}